#include "Listener.h"
#include "Framework\Math\Vector.h"

class AABBox
{
public:
	vec3	min;
	vec3	max;
	inline bool	intersects(AABBox& b){
		for(int t=0;t<3;t++)if(b.min[t]>max[t] || b.max[t]<min[t])return false;
		return true;
	}
	inline void accumulate(AABBox& b){
		for(int t=0;t<3;t++){if(b.min[t]<min[t])min[t]=b.min[t];if(b.max[t]>max[t])max[t]=b.max[t];}
	}
};

/*
find set bounds
sort by centroid along largest axis
divide sorted set in the middle.. accumulate bounds of min and max half of sets

for each half set.. repeat...
*/


class TNode{
public:
	vec3 centroid;
	TNode(){}
};

class	AABBTree	: public TNode
{
public:

	void insert(TNode&	node){

	}
	int	find(AABBox&	rgn,growvector<TNode*> result){
	}
};


class SceneClassListener : public Listener
{
public:
	virtual bool	message(const char *msg=null,void*	params=null){
		return true;
	}
	SceneClassListener(){
		Listener::listen(this,"buildSprites");
	}
};

SceneClassListener	gSceneClassListener;